package com.qianyu.project.mapper;

import com.qianyu.project.entity.LaborSubcontract;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qianyu.project.mapper.provider.EmpProvider;
import com.qianyu.project.mapper.provider.LaborSubcontractProvider;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 分包合同 Mapper 接口
 * </p>
 *
 * @author gs
 * @since 2021-01-30
 */
@Repository
public interface LaborSubcontractMapper extends BaseMapper<LaborSubcontract> {

    @SelectProvider(method = "getSubcontracts",type = LaborSubcontractProvider.class )
    List<LaborSubcontract> getSubcontracts(Map<String, Object> map);
    @Select("select max(id) from labor_subcontract where year(create_date)=year(curdate())")
    String selectMaxCode();
    @SelectProvider(method = "getTo",type = LaborSubcontractProvider.class )
    LaborSubcontract getTo(String id);
}
